import { defineStore } from 'pinia'
import { captcha } from '../api/consumer/login'

export const useLogin = defineStore('login', {
    state: () => ({
        code: '',
        key: ''
    }),
    actions: {
        async getCode() {
            let result = await captcha()
            this.code = result.data.image
            this.key = result.data.key
            console.log(result)
        }
    }
})